package matImpl;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;

public class MechaMat
{
	public static double[][] mechaMult(double[][] a, double [][] b){
			
			final double [][] c = new double[10][10];
			
			final double a00 = a[0][0];
			final double a10 = a[1][0];
			final double a20 = a[2][0];
			final double a30 = a[3][0];
			final double a40 = a[4][0];
			final double a50 = a[5][0];
			final double a60 = a[6][0];
			final double a70 = a[7][0];
			final double a80 = a[8][0];
			final double a90 = a[9][0];

			final double b00 = b[0][0];
			final double b10 = b[1][0];
			final double b20 = b[2][0];
			final double b30 = b[3][0];
			final double b40 = b[4][0];
			final double b50 = b[5][0];
			final double b60 = b[6][0];
			final double b70 = b[7][0];
			final double b80 = b[8][0];
			final double b90 = b[9][0];

			final double a01 = a[0][1];
			final double a11 = a[1][1];
			final double a21 = a[2][1];
			final double a31 = a[3][1];
			final double a41 = a[4][1];
			final double a51 = a[5][1];
			final double a61 = a[6][1];
			final double a71 = a[7][1];
			final double a81 = a[8][1];
			final double a91 = a[9][1];

			final double b01 = b[0][1];
			final double b11 = b[1][1];
			final double b21 = b[2][1];
			final double b31 = b[3][1];
			final double b41 = b[4][1];
			final double b51 = b[5][1];
			final double b61 = b[6][1];
			final double b71 = b[7][1];
			final double b81 = b[8][1];
			final double b91 = b[9][1];

			final double a02 = a[0][2];
			final double a12 = a[1][2];
			final double a22 = a[2][2];
			final double a32 = a[3][2];
			final double a42 = a[4][2];
			final double a52 = a[5][2];
			final double a62 = a[6][2];
			final double a72 = a[7][2];
			final double a82 = a[8][2];
			final double a92 = a[9][2];

			final double b02 = b[0][2];
			final double b12 = b[1][2];
			final double b22 = b[2][2];
			final double b32 = b[3][2];
			final double b42 = b[4][2];
			final double b52 = b[5][2];
			final double b62 = b[6][2];
			final double b72 = b[7][2];
			final double b82 = b[8][2];
			final double b92 = b[9][2];
			
			final double a03 = a[0][3];
			final double a13 = a[1][3];
			final double a23 = a[2][3];
			final double a33 = a[3][3];
			final double a43 = a[4][3];
			final double a53 = a[5][3];
			final double a63 = a[6][3];
			final double a73 = a[7][3];
			final double a83 = a[8][3];
			final double a93 = a[9][3];

			final double b03 = b[0][3];
			final double b13 = b[1][3];
			final double b23 = b[2][3];
			final double b33 = b[3][3];
			final double b43 = b[4][3];
			final double b53 = b[5][3];
			final double b63 = b[6][3];
			final double b73 = b[7][3];
			final double b83 = b[8][3];
			final double b93 = b[9][3];

			final double a04 = a[0][4];
			final double a14 = a[1][4];
			final double a24 = a[2][4];
			final double a34 = a[3][4];
			final double a44 = a[4][4];
			final double a54 = a[5][4];
			final double a64 = a[6][4];
			final double a74 = a[7][4];
			final double a84 = a[8][4];
			final double a94 = a[9][4];

			final double b04 = b[0][4];
			final double b14 = b[1][4];
			final double b24 = b[2][4];
			final double b34 = b[3][4];
			final double b44 = b[4][4];
			final double b54 = b[5][4];
			final double b64 = b[6][4];
			final double b74 = b[7][4];
			final double b84 = b[8][4];
			final double b94 = b[9][4];

			final double a05 = a[0][5];
			final double a15 = a[1][5];
			final double a25 = a[2][5];
			final double a35 = a[3][5];
			final double a45 = a[4][5];
			final double a55 = a[5][5];
			final double a65 = a[6][5];
			final double a75 = a[7][5];
			final double a85 = a[8][5];
			final double a95 = a[9][5];

			final double b05 = b[0][5];
			final double b15 = b[1][5];
			final double b25 = b[2][5];
			final double b35 = b[3][5];
			final double b45 = b[4][5];
			final double b55 = b[5][5];
			final double b65 = b[6][5];
			final double b75 = b[7][5];
			final double b85 = b[8][5];
			final double b95 = b[9][5];

			final double a06 = a[0][6];
			final double a16 = a[1][6];
			final double a26 = a[2][6];
			final double a36 = a[3][6];
			final double a46 = a[4][6];
			final double a56 = a[5][6];
			final double a66 = a[6][6];
			final double a76 = a[7][6];
			final double a86 = a[8][6];
			final double a96 = a[9][6];

			final double b06 = b[0][6];
			final double b16 = b[1][6];
			final double b26 = b[2][6];
			final double b36 = b[3][6];
			final double b46 = b[4][6];
			final double b56 = b[5][6];
			final double b66 = b[6][6];
			final double b76 = b[7][6];
			final double b86 = b[8][6];
			final double b96 = b[9][6];

			final double a07 = a[0][7];
			final double a17 = a[1][7];
			final double a27 = a[2][7];
			final double a37 = a[3][7];
			final double a47 = a[4][7];
			final double a57 = a[5][7];
			final double a67 = a[6][7];
			final double a77 = a[7][7];
			final double a87 = a[8][7];
			final double a97 = a[9][7];

			final double b07 = b[0][7];
			final double b17 = b[1][7];
			final double b27 = b[2][7];
			final double b37 = b[3][7];
			final double b47 = b[4][7];
			final double b57 = b[5][7];
			final double b67 = b[6][7];
			final double b77 = b[7][7];
			final double b87 = b[8][7];
			final double b97 = b[9][7];
			
			final double a08 = a[0][8];
			final double a18 = a[1][8];
			final double a28 = a[2][8];
			final double a38 = a[3][8];
			final double a48 = a[4][8];
			final double a58 = a[5][8];
			final double a68 = a[6][8];
			final double a78 = a[7][8];
			final double a88 = a[8][8];
			final double a98 = a[9][8];

			final double b08 = b[0][8];
			final double b18 = b[1][8];
			final double b28 = b[2][8];
			final double b38 = b[3][8];
			final double b48 = b[4][8];
			final double b58 = b[5][8];
			final double b68 = b[6][8];
			final double b78 = b[7][8];
			final double b88 = b[8][8];
			final double b98 = b[9][8];
			
			final double a09 = a[0][9];
			final double a19 = a[1][9];
			final double a29 = a[2][9];
			final double a39 = a[3][9];
			final double a49 = a[4][9];
			final double a59 = a[5][9];
			final double a69 = a[6][9];
			final double a79 = a[7][9];
			final double a89 = a[8][9];
			final double a99 = a[9][9];

			final double b09 = b[0][9];
			final double b19 = b[1][9];
			final double b29 = b[2][9];
			final double b39 = b[3][9];
			final double b49 = b[4][9];
			final double b59 = b[5][9];
			final double b69 = b[6][9];
			final double b79 = b[7][9];
			final double b89 = b[8][9];
			final double b99 = b[9][9];

			ExecutorService executor = Executors.newFixedThreadPool(10);
			Runnable t0 = new Runnable()
			{
				public void run()
				{
				c[0][0]=	scalar(a00,a10,a20,a30,a40,a50,a60,a70,a80,a90,b00,b01,b02,b03,b04,b05,b06,b07,b08,b09);
				c[1][0]=	scalar(a00,a10,a20,a30,a40,a50,a60,a70,a80,a90,b10,b11,b12,b13,b14,b15,b16,b17,b18,b19);
				c[2][0]=	scalar(a00,a10,a20,a30,a40,a50,a60,a70,a80,a90,b20,b21,b22,b23,b24,b25,b26,b27,b28,b29);
				c[3][0]=	scalar(a00,a10,a20,a30,a40,a50,a60,a70,a80,a90,b30,b31,b32,b33,b34,b35,b36,b37,b38,b39);
				c[4][0]=	scalar(a00,a10,a20,a30,a40,a50,a60,a70,a80,a90,b40,b41,b42,b43,b44,b45,b46,b47,b48,b49);
				c[5][0]=	scalar(a00,a10,a20,a30,a40,a50,a60,a70,a80,a90,b50,b51,b52,b53,b54,b55,b56,b57,b58,b59);
				c[6][0]=	scalar(a00,a10,a20,a30,a40,a50,a60,a70,a80,a90,b60,b61,b62,b63,b64,b65,b66,b67,b68,b69);
				c[7][0]=	scalar(a00,a10,a20,a30,a40,a50,a60,a70,a80,a90,b70,b71,b72,b73,b74,b75,b76,b77,b78,b79);
				c[8][0]=	scalar(a00,a10,a20,a30,a40,a50,a60,a70,a80,a90,b80,b81,b82,b83,b84,b85,b86,b87,b88,b89);
				c[9][0]=	scalar(a00,a10,a20,a30,a40,a50,a60,a70,a80,a90,b90,b91,b92,b93,b94,b95,b96,b97,b98,b99);
				}};
			executor.execute(t0);
			Runnable t1 = new Runnable()
			{
				public void run()
				{	
				c[0][1]=	scalar(a01,a11,a21,a31,a41,a51,a61,a71,a81,a91,b00,b01,b02,b03,b04,b05,b06,b07,b08,b09);
				c[1][1]=	scalar(a01,a11,a21,a31,a41,a51,a61,a71,a81,a91,b10,b11,b12,b13,b14,b15,b16,b17,b18,b19);
				c[2][1]=	scalar(a01,a11,a21,a31,a41,a51,a61,a71,a81,a91,b20,b21,b22,b23,b24,b25,b26,b27,b28,b29);
				c[3][1]=	scalar(a01,a11,a21,a31,a41,a51,a61,a71,a81,a91,b30,b31,b32,b33,b34,b35,b36,b37,b38,b39);
				c[4][1]=	scalar(a01,a11,a21,a31,a41,a51,a61,a71,a81,a91,b40,b41,b42,b43,b44,b45,b46,b47,b48,b49);
				c[5][1]=	scalar(a01,a11,a21,a31,a41,a51,a61,a71,a81,a91,b50,b51,b52,b53,b54,b55,b56,b57,b58,b59);
				c[6][1]=	scalar(a01,a11,a21,a31,a41,a51,a61,a71,a81,a91,b60,b61,b62,b63,b64,b65,b66,b67,b68,b69);
				c[7][1]=	scalar(a01,a11,a21,a31,a41,a51,a61,a71,a81,a91,b70,b71,b72,b73,b74,b75,b76,b77,b78,b79);
				c[8][1]=	scalar(a01,a11,a21,a31,a41,a51,a61,a71,a81,a91,b80,b81,b82,b83,b84,b85,b86,b87,b88,b89);
				c[9][1]=	scalar(a01,a11,a21,a31,a41,a51,a61,a71,a81,a91,b90,b91,b92,b93,b94,b95,b96,b97,b98,b99);
				}};
				executor.execute(t1);
				Runnable t2 = new Runnable()
				{
						public void run()
						{	
				c[0][2]=	scalar(a02,a12,a22,a32,a42,a52,a62,a72,a82,a92,b00,b01,b02,b03,b04,b05,b06,b07,b08,b09);
				c[1][2]=	scalar(a02,a12,a22,a32,a42,a52,a62,a72,a82,a92,b10,b11,b12,b13,b14,b15,b16,b17,b18,b19);
				c[2][2]=	scalar(a02,a12,a22,a32,a42,a52,a62,a72,a82,a92,b20,b21,b22,b23,b24,b25,b26,b27,b28,b29);
				c[3][2]=	scalar(a02,a12,a22,a32,a42,a52,a62,a72,a82,a92,b30,b31,b32,b33,b34,b35,b36,b37,b38,b39);
				c[4][2]=	scalar(a02,a12,a22,a32,a42,a52,a62,a72,a82,a92,b40,b41,b42,b43,b44,b45,b46,b47,b48,b49);
				c[5][2]=	scalar(a02,a12,a22,a32,a42,a52,a62,a72,a82,a92,b50,b51,b52,b53,b54,b55,b56,b57,b58,b59);
				c[6][2]=	scalar(a02,a12,a22,a32,a42,a52,a62,a72,a82,a92,b60,b61,b62,b63,b64,b65,b66,b67,b68,b69);
				c[7][2]=	scalar(a02,a12,a22,a32,a42,a52,a62,a72,a82,a92,b70,b71,b72,b73,b74,b75,b76,b77,b78,b79);
				c[8][2]=	scalar(a02,a12,a22,a32,a42,a52,a62,a72,a82,a92,b80,b81,b82,b83,b84,b85,b86,b87,b88,b89);
				c[9][2]=	scalar(a02,a12,a22,a32,a42,a52,a62,a72,a82,a92,b90,b91,b92,b93,b94,b95,b96,b97,b98,b99);
						}};
						executor.execute(t2);
						Runnable t3 = new Runnable()
						{
							public void run()
							{	
				c[0][3]=	scalar(a03,a13,a23,a33,a43,a53,a63,a73,a83,a93,b00,b01,b02,b03,b04,b05,b06,b07,b08,b09);
				c[1][3]=	scalar(a03,a13,a23,a33,a43,a53,a63,a73,a83,a93,b10,b11,b12,b13,b14,b15,b16,b17,b18,b19);
				c[2][3]=	scalar(a03,a13,a23,a33,a43,a53,a63,a73,a83,a93,b20,b21,b22,b23,b24,b25,b26,b27,b28,b29);
				c[3][3]=	scalar(a03,a13,a23,a33,a43,a53,a63,a73,a83,a93,b30,b31,b32,b33,b34,b35,b36,b37,b38,b39);
				c[4][3]=	scalar(a03,a13,a23,a33,a43,a53,a63,a73,a83,a93,b40,b41,b42,b43,b44,b45,b46,b47,b48,b49);
				c[5][3]=	scalar(a03,a13,a23,a33,a43,a53,a63,a73,a83,a93,b50,b51,b52,b53,b54,b55,b56,b57,b58,b59);
				c[6][3]=	scalar(a03,a13,a23,a33,a43,a53,a63,a73,a83,a93,b60,b61,b62,b63,b64,b65,b66,b67,b68,b69);
				c[7][3]=	scalar(a03,a13,a23,a33,a43,a53,a63,a73,a83,a93,b70,b71,b72,b73,b74,b75,b76,b77,b78,b79);
				c[8][3]=	scalar(a03,a13,a23,a33,a43,a53,a63,a73,a83,a93,b80,b81,b82,b83,b84,b85,b86,b87,b88,b89);
				c[9][3]=	scalar(a03,a13,a23,a33,a43,a53,a63,a73,a83,a93,b90,b91,b92,b93,b94,b95,b96,b97,b98,b99);
							}};
							executor.execute(t3);
							Runnable t4 = new Runnable()
							{
									public void run()
									{			
				c[0][4]=	scalar(a04,a14,a24,a34,a44,a54,a64,a74,a84,a94,b00,b01,b02,b03,b04,b05,b06,b07,b08,b09);
				c[1][4]=	scalar(a04,a14,a24,a34,a44,a54,a64,a74,a84,a94,b10,b11,b12,b13,b14,b15,b16,b17,b18,b19);
				c[2][4]=	scalar(a04,a14,a24,a34,a44,a54,a64,a74,a84,a94,b20,b21,b22,b23,b24,b25,b26,b27,b28,b29);
				c[3][4]=	scalar(a04,a14,a24,a34,a44,a54,a64,a74,a84,a94,b30,b31,b32,b33,b34,b35,b36,b37,b38,b39);
				c[4][4]=	scalar(a04,a14,a24,a34,a44,a54,a64,a74,a84,a94,b40,b41,b42,b43,b44,b45,b46,b47,b48,b49);
				c[5][4]=	scalar(a04,a14,a24,a34,a44,a54,a64,a74,a84,a94,b50,b51,b52,b53,b54,b55,b56,b57,b58,b59);
				c[6][4]=	scalar(a04,a14,a24,a34,a44,a54,a64,a74,a84,a94,b60,b61,b62,b63,b64,b65,b66,b67,b68,b69);
				c[7][4]=	scalar(a04,a14,a24,a34,a44,a54,a64,a74,a84,a94,b70,b71,b72,b73,b74,b75,b76,b77,b78,b79);
				c[8][4]=	scalar(a04,a14,a24,a34,a44,a54,a64,a74,a84,a94,b80,b81,b82,b83,b84,b85,b86,b87,b88,b89);
				c[9][4]=	scalar(a04,a14,a24,a34,a44,a54,a64,a74,a84,a94,b90,b91,b92,b93,b94,b95,b96,b97,b98,b99);
									}};
									executor.execute(t4);
									Runnable t5 = new Runnable()
									{
										public void run()
										{						
				c[0][5]=	scalar(a05,a15,a25,a35,a45,a55,a65,a75,a85,a95,b00,b01,b02,b03,b04,b05,b06,b07,b08,b09);
				c[1][5]=	scalar(a05,a15,a25,a35,a45,a55,a65,a75,a85,a95,b10,b11,b12,b13,b14,b15,b16,b17,b18,b19);
				c[2][5]=	scalar(a05,a15,a25,a35,a45,a55,a65,a75,a85,a95,b20,b21,b22,b23,b24,b25,b26,b27,b28,b29);
				c[3][5]=	scalar(a05,a15,a25,a35,a45,a55,a65,a75,a85,a95,b30,b31,b32,b33,b34,b35,b36,b37,b38,b39);
				c[4][5]=	scalar(a05,a15,a25,a35,a45,a55,a65,a75,a85,a95,b40,b41,b42,b43,b44,b45,b46,b47,b48,b49);
				c[5][5]=	scalar(a05,a15,a25,a35,a45,a55,a65,a75,a85,a95,b50,b51,b52,b53,b54,b55,b56,b57,b58,b59);
				c[6][5]=	scalar(a05,a15,a25,a35,a45,a55,a65,a75,a85,a95,b60,b61,b62,b63,b64,b65,b66,b67,b68,b69);
				c[7][5]=	scalar(a05,a15,a25,a35,a45,a55,a65,a75,a85,a95,b70,b71,b72,b73,b74,b75,b76,b77,b78,b79);
				c[8][5]=	scalar(a05,a15,a25,a35,a45,a55,a65,a75,a85,a95,b80,b81,b82,b83,b84,b85,b86,b87,b88,b89);
				c[9][5]=	scalar(a05,a15,a25,a35,a45,a55,a65,a75,a85,a95,b90,b91,b92,b93,b94,b95,b96,b97,b98,b99);
										}};
										executor.execute(t5);
										Runnable t6 = new Runnable()
										{
		public void run()
		{				
				c[0][6]=	scalar(a06,a16,a26,a36,a46,a56,a66,a76,a86,a96,b00,b01,b02,b03,b04,b05,b06,b07,b08,b09);
				c[1][6]=	scalar(a06,a16,a26,a36,a46,a56,a66,a76,a86,a96,b10,b11,b12,b13,b14,b15,b16,b17,b18,b19);
				c[2][6]=	scalar(a06,a16,a26,a36,a46,a56,a66,a76,a86,a96,b20,b21,b22,b23,b24,b25,b26,b27,b28,b29);
				c[3][6]=	scalar(a06,a16,a26,a36,a46,a56,a66,a76,a86,a96,b30,b31,b32,b33,b34,b35,b36,b37,b38,b39);
				c[4][6]=	scalar(a06,a16,a26,a36,a46,a56,a66,a76,a86,a96,b40,b41,b42,b43,b44,b45,b46,b47,b48,b49);
				c[5][6]=	scalar(a06,a16,a26,a36,a46,a56,a66,a76,a86,a96,b50,b51,b52,b53,b54,b55,b56,b57,b58,b59);
				c[6][6]=	scalar(a06,a16,a26,a36,a46,a56,a66,a76,a86,a96,b60,b61,b62,b63,b64,b65,b66,b67,b68,b69);
				c[7][6]=	scalar(a06,a16,a26,a36,a46,a56,a66,a76,a86,a96,b70,b71,b72,b73,b74,b75,b76,b77,b78,b79);
				c[8][6]=	scalar(a06,a16,a26,a36,a46,a56,a66,a76,a86,a96,b80,b81,b82,b83,b84,b85,b86,b87,b88,b89);
				c[9][6]=	scalar(a06,a16,a26,a36,a46,a56,a66,a76,a86,a96,b90,b91,b92,b93,b94,b95,b96,b97,b98,b99);
		}};
		executor.execute(t6);
		Runnable t7 = new Runnable()
		{
			public void run()
			{			
				c[0][7]=	scalar(a07,a17,a27,a37,a47,a57,a67,a77,a87,a97,b00,b01,b02,b03,b04,b05,b06,b07,b08,b09);
				c[1][7]=	scalar(a07,a17,a27,a37,a47,a57,a67,a77,a87,a97,b10,b11,b12,b13,b14,b15,b16,b17,b18,b19);
				c[2][7]=	scalar(a07,a17,a27,a37,a47,a57,a67,a77,a87,a97,b20,b21,b22,b23,b24,b25,b26,b27,b28,b29);
				c[3][7]=	scalar(a07,a17,a27,a37,a47,a57,a67,a77,a87,a97,b30,b31,b32,b33,b34,b35,b36,b37,b38,b39);
				c[4][7]=	scalar(a07,a17,a27,a37,a47,a57,a67,a77,a87,a97,b40,b41,b42,b43,b44,b45,b46,b47,b48,b49);
				c[5][7]=	scalar(a07,a17,a27,a37,a47,a57,a67,a77,a87,a97,b50,b51,b52,b53,b54,b55,b56,b57,b58,b59);
				c[6][7]=	scalar(a07,a17,a27,a37,a47,a57,a67,a77,a87,a97,b60,b61,b62,b63,b64,b65,b66,b67,b68,b69);
				c[7][7]=	scalar(a07,a17,a27,a37,a47,a57,a67,a77,a87,a97,b70,b71,b72,b73,b74,b75,b76,b77,b78,b79);
				c[8][7]=	scalar(a07,a17,a27,a37,a47,a57,a67,a77,a87,a97,b80,b81,b82,b83,b84,b85,b86,b87,b88,b89);
				c[9][7]=	scalar(a07,a17,a27,a37,a47,a57,a67,a77,a87,a97,b90,b91,b92,b93,b94,b95,b96,b97,b98,b99);
			}};
			executor.execute(t7);
			Runnable t8 = new Runnable()
			{
				public void run()
				{	
				c[0][8]=	scalar(a08,a18,a28,a38,a48,a58,a68,a78,a88,a98,b00,b01,b02,b03,b04,b05,b06,b07,b08,b09);
				c[1][8]=	scalar(a08,a18,a28,a38,a48,a58,a68,a78,a88,a98,b10,b11,b12,b13,b14,b15,b16,b17,b18,b19);
				c[2][8]=	scalar(a08,a18,a28,a38,a48,a58,a68,a78,a88,a98,b20,b21,b22,b23,b24,b25,b26,b27,b28,b29);
				c[3][8]=	scalar(a08,a18,a28,a38,a48,a58,a68,a78,a88,a98,b30,b31,b32,b33,b34,b35,b36,b37,b38,b39);
				c[4][8]=	scalar(a08,a18,a28,a38,a48,a58,a68,a78,a88,a98,b40,b41,b42,b43,b44,b45,b46,b47,b48,b49);
				c[5][8]=	scalar(a08,a18,a28,a38,a48,a58,a68,a78,a88,a98,b50,b51,b52,b53,b54,b55,b56,b57,b58,b59);
				c[6][8]=	scalar(a08,a18,a28,a38,a48,a58,a68,a78,a88,a98,b60,b61,b62,b63,b64,b65,b66,b67,b68,b69);
				c[7][8]=	scalar(a08,a18,a28,a38,a48,a58,a68,a78,a88,a98,b70,b71,b72,b73,b74,b75,b76,b77,b78,b79);
				c[8][8]=	scalar(a08,a18,a28,a38,a48,a58,a68,a78,a88,a98,b80,b81,b82,b83,b84,b85,b86,b87,b88,b89);
				c[9][8]=	scalar(a08,a18,a28,a38,a48,a58,a68,a78,a88,a98,b90,b91,b92,b93,b94,b95,b96,b97,b98,b99);
				}};
			executor.execute(t8);
			Runnable t9 = new Runnable()
			{
					public void run()
					{	
						c[0][9]=	scalar(a09,a19,a29,a39,a49,a59,a69,a79,a89,a99,b00,b01,b02,b03,b04,b05,b06,b07,b08,b09);
						c[1][9]=	scalar(a09,a19,a29,a39,a49,a59,a69,a79,a89,a99,b10,b11,b12,b13,b14,b15,b16,b17,b18,b19);
						c[2][9]=	scalar(a09,a19,a29,a39,a49,a59,a69,a79,a89,a99,b20,b21,b22,b23,b24,b25,b26,b27,b28,b29);
						c[3][9]=	scalar(a09,a19,a29,a39,a49,a59,a69,a79,a89,a99,b30,b31,b32,b33,b34,b35,b36,b37,b38,b39);
						c[4][9]=	scalar(a09,a19,a29,a39,a49,a59,a69,a79,a89,a99,b40,b41,b42,b43,b44,b45,b46,b47,b48,b49);
						c[5][9]=	scalar(a09,a19,a29,a39,a49,a59,a69,a79,a89,a99,b50,b51,b52,b53,b54,b55,b56,b57,b58,b59);
						c[6][9]=	scalar(a09,a19,a29,a39,a49,a59,a69,a79,a89,a99,b60,b61,b62,b63,b64,b65,b66,b67,b68,b69);
						c[7][9]=	scalar(a09,a19,a29,a39,a49,a59,a69,a79,a89,a99,b70,b71,b72,b73,b74,b75,b76,b77,b78,b79);
						c[8][9]=	scalar(a09,a19,a29,a39,a49,a59,a69,a79,a89,a99,b80,b81,b82,b83,b84,b85,b86,b87,b88,b89);
						c[9][9]=	scalar(a09,a19,a29,a39,a49,a59,a69,a79,a89,a99,b90,b91,b92,b93,b94,b95,b96,b97,b98,b99);
					}
				};
			executor.execute(t9);
			int waitTimeInHours = 1;
			try
			{
				executor.shutdown();
				boolean isTerminated = executor.awaitTermination(waitTimeInHours, TimeUnit.HOURS);
				if (!isTerminated)
				{
					System.out.println("ERROR");
				}
			}
			catch (InterruptedException ignored)
			{
			}
			/*
			
				c[0][0]=	scalar(a00,a10,a20,a30,a40,a50,a60,a70,a80,a90,b00,b01,b02,b03,b04,b05,b06,b07,b08,b09);
				c[0][1]=	scalar(a00,a10,a20,a30,a40,a50,a60,a70,a80,a90,b10,b11,b12,b13,b14,b15,b16,b17,b18,b19);
				c[0][2]=	scalar(a00,a10,a20,a30,a40,a50,a60,a70,a80,a90,b20,b21,b22,b23,b24,b25,b26,b27,b28,b29);
				c[0][3]=	scalar(a00,a10,a20,a30,a40,a50,a60,a70,a80,a90,b30,b31,b32,b33,b34,b35,b36,b37,b38,b39);
				c[0][4]=	scalar(a00,a10,a20,a30,a40,a50,a60,a70,a80,a90,b40,b41,b42,b43,b44,b45,b46,b47,b48,b49);
				c[0][5]=	scalar(a00,a10,a20,a30,a40,a50,a60,a70,a80,a90,b50,b51,b52,b53,b54,b55,b56,b57,b58,b59);
				c[0][6]=	scalar(a00,a10,a20,a30,a40,a50,a60,a70,a80,a90,b60,b61,b62,b63,b64,b65,b66,b67,b68,b69);
				c[0][7]=	scalar(a00,a10,a20,a30,a40,a50,a60,a70,a80,a90,b70,b71,b72,b73,b74,b75,b76,b77,b78,b79);
				c[0][8]=	scalar(a00,a10,a20,a30,a40,a50,a60,a70,a80,a90,b80,b81,b82,b83,b84,b85,b86,b87,b88,b89);
				c[0][9]=	scalar(a00,a10,a20,a30,a40,a50,a60,a70,a80,a90,b90,b91,b92,b93,b94,b95,b96,b97,b98,b99);
				
				c[1][0]=	scalar(a01,a11,a21,a31,a41,a51,a61,a71,a81,a91,b00,b01,b02,b03,b04,b05,b06,b07,b08,b09);
				c[1][1]=	scalar(a01,a11,a21,a31,a41,a51,a61,a71,a81,a91,b10,b11,b12,b13,b14,b15,b16,b17,b18,b19);
				c[1][2]=	scalar(a01,a11,a21,a31,a41,a51,a61,a71,a81,a91,b20,b21,b22,b23,b24,b25,b26,b27,b28,b29);
				c[1][3]=	scalar(a01,a11,a21,a31,a41,a51,a61,a71,a81,a91,b30,b31,b32,b33,b34,b35,b36,b37,b38,b39);
				c[1][4]=	scalar(a01,a11,a21,a31,a41,a51,a61,a71,a81,a91,b40,b41,b42,b43,b44,b45,b46,b47,b48,b49);
				c[1][5]=	scalar(a01,a11,a21,a31,a41,a51,a61,a71,a81,a91,b50,b51,b52,b53,b54,b55,b56,b57,b58,b59);
				c[1][6]=	scalar(a01,a11,a21,a31,a41,a51,a61,a71,a81,a91,b60,b61,b62,b63,b64,b65,b66,b67,b68,b69);
				c[1][7]=	scalar(a01,a11,a21,a31,a41,a51,a61,a71,a81,a91,b70,b71,b72,b73,b74,b75,b76,b77,b78,b79);
				c[1][8]=	scalar(a01,a11,a21,a31,a41,a51,a61,a71,a81,a91,b80,b81,b82,b83,b84,b85,b86,b87,b88,b89);
				c[1][9]=	scalar(a01,a11,a21,a31,a41,a51,a61,a71,a81,a91,b90,b91,b92,b93,b94,b95,b96,b97,b98,b99);
				
				c[2][0]=	scalar(a02,a12,a22,a32,a42,a52,a62,a72,a82,a92,b00,b01,b02,b03,b04,b05,b06,b07,b08,b09);
				c[2][1]=	scalar(a02,a12,a22,a32,a42,a52,a62,a72,a82,a92,b10,b11,b12,b13,b14,b15,b16,b17,b18,b19);
				c[2][2]=	scalar(a02,a12,a22,a32,a42,a52,a62,a72,a82,a92,b20,b21,b22,b23,b24,b25,b26,b27,b28,b29);
				c[2][3]=	scalar(a02,a12,a22,a32,a42,a52,a62,a72,a82,a92,b30,b31,b32,b33,b34,b35,b36,b37,b38,b39);
				c[2][4]=	scalar(a02,a12,a22,a32,a42,a52,a62,a72,a82,a92,b40,b41,b42,b43,b44,b45,b46,b47,b48,b49);
				c[2][5]=	scalar(a02,a12,a22,a32,a42,a52,a62,a72,a82,a92,b50,b51,b52,b53,b54,b55,b56,b57,b58,b59);
				c[2][6]=	scalar(a02,a12,a22,a32,a42,a52,a62,a72,a82,a92,b60,b61,b62,b63,b64,b65,b66,b67,b68,b69);
				c[2][7]=	scalar(a02,a12,a22,a32,a42,a52,a62,a72,a82,a92,b70,b71,b72,b73,b74,b75,b76,b77,b78,b79);
				c[2][8]=	scalar(a02,a12,a22,a32,a42,a52,a62,a72,a82,a92,b80,b81,b82,b83,b84,b85,b86,b87,b88,b89);
				c[2][9]=	scalar(a02,a12,a22,a32,a42,a52,a62,a72,a82,a92,b90,b91,b92,b93,b94,b95,b96,b97,b98,b99);
				
				c[3][0]=	scalar(a03,a13,a23,a33,a43,a53,a63,a73,a83,a93,b00,b01,b02,b03,b04,b05,b06,b07,b08,b09);
				c[3][1]=	scalar(a03,a13,a23,a33,a43,a53,a63,a73,a83,a93,b10,b11,b12,b13,b14,b15,b16,b17,b18,b19);
				c[3][2]=	scalar(a03,a13,a23,a33,a43,a53,a63,a73,a83,a93,b20,b21,b22,b23,b24,b25,b26,b27,b28,b29);
				c[3][3]=	scalar(a03,a13,a23,a33,a43,a53,a63,a73,a83,a93,b30,b31,b32,b33,b34,b35,b36,b37,b38,b39);
				c[3][4]=	scalar(a03,a13,a23,a33,a43,a53,a63,a73,a83,a93,b40,b41,b42,b43,b44,b45,b46,b47,b48,b49);
				c[3][5]=	scalar(a03,a13,a23,a33,a43,a53,a63,a73,a83,a93,b50,b51,b52,b53,b54,b55,b56,b57,b58,b59);
				c[3][6]=	scalar(a03,a13,a23,a33,a43,a53,a63,a73,a83,a93,b60,b61,b62,b63,b64,b65,b66,b67,b68,b69);
				c[3][7]=	scalar(a03,a13,a23,a33,a43,a53,a63,a73,a83,a93,b70,b71,b72,b73,b74,b75,b76,b77,b78,b79);
				c[3][8]=	scalar(a03,a13,a23,a33,a43,a53,a63,a73,a83,a93,b80,b81,b82,b83,b84,b85,b86,b87,b88,b89);
				c[3][9]=	scalar(a03,a13,a23,a33,a43,a53,a63,a73,a83,a93,b90,b91,b92,b93,b94,b95,b96,b97,b98,b99);
				
				c[4][0]=	scalar(a04,a14,a24,a34,a44,a54,a64,a74,a84,a94,b00,b01,b02,b03,b04,b05,b06,b07,b08,b09);
				c[4][1]=	scalar(a04,a14,a24,a34,a44,a54,a64,a74,a84,a94,b10,b11,b12,b13,b14,b15,b16,b17,b18,b19);
				c[4][2]=	scalar(a04,a14,a24,a34,a44,a54,a64,a74,a84,a94,b20,b21,b22,b23,b24,b25,b26,b27,b28,b29);
				c[4][3]=	scalar(a04,a14,a24,a34,a44,a54,a64,a74,a84,a94,b30,b31,b32,b33,b34,b35,b36,b37,b38,b39);
				c[4][4]=	scalar(a04,a14,a24,a34,a44,a54,a64,a74,a84,a94,b40,b41,b42,b43,b44,b45,b46,b47,b48,b49);
				c[4][5]=	scalar(a04,a14,a24,a34,a44,a54,a64,a74,a84,a94,b50,b51,b52,b53,b54,b55,b56,b57,b58,b59);
				c[4][6]=	scalar(a04,a14,a24,a34,a44,a54,a64,a74,a84,a94,b60,b61,b62,b63,b64,b65,b66,b67,b68,b69);
				c[4][7]=	scalar(a04,a14,a24,a34,a44,a54,a64,a74,a84,a94,b70,b71,b72,b73,b74,b75,b76,b77,b78,b79);
				c[4][8]=	scalar(a04,a14,a24,a34,a44,a54,a64,a74,a84,a94,b80,b81,b82,b83,b84,b85,b86,b87,b88,b89);
				c[4][9]=	scalar(a04,a14,a24,a34,a44,a54,a64,a74,a84,a94,b90,b91,b92,b93,b94,b95,b96,b97,b98,b99);
				
				c[5][0]=	scalar(a05,a15,a25,a35,a45,a55,a65,a75,a85,a95,b00,b01,b02,b03,b04,b05,b06,b07,b08,b09);
				c[5][1]=	scalar(a05,a15,a25,a35,a45,a55,a65,a75,a85,a95,b10,b11,b12,b13,b14,b15,b16,b17,b18,b19);
				c[5][2]=	scalar(a05,a15,a25,a35,a45,a55,a65,a75,a85,a95,b20,b21,b22,b23,b24,b25,b26,b27,b28,b29);
				c[5][3]=	scalar(a05,a15,a25,a35,a45,a55,a65,a75,a85,a95,b30,b31,b32,b33,b34,b35,b36,b37,b38,b39);
				c[5][4]=	scalar(a05,a15,a25,a35,a45,a55,a65,a75,a85,a95,b40,b41,b42,b43,b44,b45,b46,b47,b48,b49);
				c[5][5]=	scalar(a05,a15,a25,a35,a45,a55,a65,a75,a85,a95,b50,b51,b52,b53,b54,b55,b56,b57,b58,b59);
				c[5][6]=	scalar(a05,a15,a25,a35,a45,a55,a65,a75,a85,a95,b60,b61,b62,b63,b64,b65,b66,b67,b68,b69);
				c[5][7]=	scalar(a05,a15,a25,a35,a45,a55,a65,a75,a85,a95,b70,b71,b72,b73,b74,b75,b76,b77,b78,b79);
				c[5][8]=	scalar(a05,a15,a25,a35,a45,a55,a65,a75,a85,a95,b80,b81,b82,b83,b84,b85,b86,b87,b88,b89);
				c[5][9]=	scalar(a05,a15,a25,a35,a45,a55,a65,a75,a85,a95,b90,b91,b92,b93,b94,b95,b96,b97,b98,b99);
				
				c[6][0]=	scalar(a06,a16,a26,a36,a46,a56,a66,a76,a86,a96,b00,b01,b02,b03,b04,b05,b06,b07,b08,b09);
				c[6][1]=	scalar(a06,a16,a26,a36,a46,a56,a66,a76,a86,a96,b10,b11,b12,b13,b14,b15,b16,b17,b18,b19);
				c[6][2]=	scalar(a06,a16,a26,a36,a46,a56,a66,a76,a86,a96,b20,b21,b22,b23,b24,b25,b26,b27,b28,b29);
				c[6][3]=	scalar(a06,a16,a26,a36,a46,a56,a66,a76,a86,a96,b30,b31,b32,b33,b34,b35,b36,b37,b38,b39);
				c[6][4]=	scalar(a06,a16,a26,a36,a46,a56,a66,a76,a86,a96,b40,b41,b42,b43,b44,b45,b46,b47,b48,b49);
				c[6][5]=	scalar(a06,a16,a26,a36,a46,a56,a66,a76,a86,a96,b50,b51,b52,b53,b54,b55,b56,b57,b58,b59);
				c[6][6]=	scalar(a06,a16,a26,a36,a46,a56,a66,a76,a86,a96,b60,b61,b62,b63,b64,b65,b66,b67,b68,b69);
				c[6][7]=	scalar(a06,a16,a26,a36,a46,a56,a66,a76,a86,a96,b70,b71,b72,b73,b74,b75,b76,b77,b78,b79);
				c[6][8]=	scalar(a06,a16,a26,a36,a46,a56,a66,a76,a86,a96,b80,b81,b82,b83,b84,b85,b86,b87,b88,b89);
				c[6][9]=	scalar(a06,a16,a26,a36,a46,a56,a66,a76,a86,a96,b90,b91,b92,b93,b94,b95,b96,b97,b98,b99);
				
				c[7][0]=	scalar(a07,a17,a27,a37,a47,a57,a67,a77,a87,a97,b00,b01,b02,b03,b04,b05,b06,b07,b08,b09);
				c[7][1]=	scalar(a07,a17,a27,a37,a47,a57,a67,a77,a87,a97,b10,b11,b12,b13,b14,b15,b16,b17,b18,b19);
				c[7][2]=	scalar(a07,a17,a27,a37,a47,a57,a67,a77,a87,a97,b20,b21,b22,b23,b24,b25,b26,b27,b28,b29);
				c[7][3]=	scalar(a07,a17,a27,a37,a47,a57,a67,a77,a87,a97,b30,b31,b32,b33,b34,b35,b36,b37,b38,b39);
				c[7][4]=	scalar(a07,a17,a27,a37,a47,a57,a67,a77,a87,a97,b40,b41,b42,b43,b44,b45,b46,b47,b48,b49);
				c[7][5]=	scalar(a07,a17,a27,a37,a47,a57,a67,a77,a87,a97,b50,b51,b52,b53,b54,b55,b56,b57,b58,b59);
				c[7][6]=	scalar(a07,a17,a27,a37,a47,a57,a67,a77,a87,a97,b60,b61,b62,b63,b64,b65,b66,b67,b68,b69);
				c[7][7]=	scalar(a07,a17,a27,a37,a47,a57,a67,a77,a87,a97,b70,b71,b72,b73,b74,b75,b76,b77,b78,b79);
				c[7][8]=	scalar(a07,a17,a27,a37,a47,a57,a67,a77,a87,a97,b80,b81,b82,b83,b84,b85,b86,b87,b88,b89);
				c[7][9]=	scalar(a07,a17,a27,a37,a47,a57,a67,a77,a87,a97,b90,b91,b92,b93,b94,b95,b96,b97,b98,b99);
				
				c[8][0]=	scalar(a08,a18,a28,a38,a48,a58,a68,a78,a88,a98,b00,b01,b02,b03,b04,b05,b06,b07,b08,b09);
				c[8][1]=	scalar(a08,a18,a28,a38,a48,a58,a68,a78,a88,a98,b10,b11,b12,b13,b14,b15,b16,b17,b18,b19);
				c[8][2]=	scalar(a08,a18,a28,a38,a48,a58,a68,a78,a88,a98,b20,b21,b22,b23,b24,b25,b26,b27,b28,b29);
				c[8][3]=	scalar(a08,a18,a28,a38,a48,a58,a68,a78,a88,a98,b30,b31,b32,b33,b34,b35,b36,b37,b38,b39);
				c[8][4]=	scalar(a08,a18,a28,a38,a48,a58,a68,a78,a88,a98,b40,b41,b42,b43,b44,b45,b46,b47,b48,b49);
				c[8][5]=	scalar(a08,a18,a28,a38,a48,a58,a68,a78,a88,a98,b50,b51,b52,b53,b54,b55,b56,b57,b58,b59);
				c[8][6]=	scalar(a08,a18,a28,a38,a48,a58,a68,a78,a88,a98,b60,b61,b62,b63,b64,b65,b66,b67,b68,b69);
				c[8][7]=	scalar(a08,a18,a28,a38,a48,a58,a68,a78,a88,a98,b70,b71,b72,b73,b74,b75,b76,b77,b78,b79);
				c[8][8]=	scalar(a08,a18,a28,a38,a48,a58,a68,a78,a88,a98,b80,b81,b82,b83,b84,b85,b86,b87,b88,b89);
				c[8][9]=	scalar(a08,a18,a28,a38,a48,a58,a68,a78,a88,a98,b90,b91,b92,b93,b94,b95,b96,b97,b98,b99);
				
				c[9][0]=	scalar(a09,a19,a29,a39,a49,a59,a69,a79,a89,a99,b00,b01,b02,b03,b04,b05,b06,b07,b08,b09);
				c[9][1]=	scalar(a09,a19,a29,a39,a49,a59,a69,a79,a89,a99,b10,b11,b12,b13,b14,b15,b16,b17,b18,b19);
				c[9][2]=	scalar(a09,a19,a29,a39,a49,a59,a69,a79,a89,a99,b20,b21,b22,b23,b24,b25,b26,b27,b28,b29);
				c[9][3]=	scalar(a09,a19,a29,a39,a49,a59,a69,a79,a89,a99,b30,b31,b32,b33,b34,b35,b36,b37,b38,b39);
				c[9][4]=	scalar(a09,a19,a29,a39,a49,a59,a69,a79,a89,a99,b40,b41,b42,b43,b44,b45,b46,b47,b48,b49);
				c[9][5]=	scalar(a09,a19,a29,a39,a49,a59,a69,a79,a89,a99,b50,b51,b52,b53,b54,b55,b56,b57,b58,b59);
				c[9][6]=	scalar(a09,a19,a29,a39,a49,a59,a69,a79,a89,a99,b60,b61,b62,b63,b64,b65,b66,b67,b68,b69);
				c[9][7]=	scalar(a09,a19,a29,a39,a49,a59,a69,a79,a89,a99,b70,b71,b72,b73,b74,b75,b76,b77,b78,b79);
				c[9][8]=	scalar(a09,a19,a29,a39,a49,a59,a69,a79,a89,a99,b80,b81,b82,b83,b84,b85,b86,b87,b88,b89);
				c[9][9]=	scalar(a09,a19,a29,a39,a49,a59,a69,a79,a89,a99,b90,b91,b92,b93,b94,b95,b96,b97,b98,b99);
			*/
			return c;
	}
	private static double scalar (
				 double a0,  double a1, double a2, double a3, double a4,
				 double a5, double a6, double a7, double a8, double a9,
				 double b0,  double b1, double b2, double b3, double b4,
				 double b5, double b6, double b7, double b8, double b9){			
			return a0*b0 + a1*b1 + a2*b2 + a3*b3 + a4*b4 + a5*b5 + a6*b6 + a7*b7 + a8*b8 + a9*b9;

}
	
}
